//
//  PDFFactory.h
//  ActiveDeck
//
//  Created by Michael Cohen on 10/24/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "SlideViewController.h"
#import "AD_ContainerOB.h"
#import "ContainerController.h"

@class ActiveDeckViewController;

@interface PDFFactory : NSObject <UIDocumentInteractionControllerDelegate>
{
    NSString* presentationID;
    
    NSMutableArray* slides;
    
    AD_ContainerOB* notebook;
    
    BOOL isCancelled;
    
    NSString *pdfPath;
    NSString *username;
    
    NSMutableData *pdfData;
    
    NSArray* documentDirectories;
    NSString* documentDirectory;
    NSString* documentDirectoryFilename;
    
    UIDocumentInteractionController *docController;
    
    ActiveDeckViewController *callingVC;
    
    NSMutableArray *viewsToSave;
    
    CGRect pdfBounds;
    
    NSMutableArray *currentPos;
}

@property (nonatomic, retain) NSString* presentationID;
@property (nonatomic, retain) NSMutableArray* slides;
@property (nonatomic, retain) AD_ContainerOB* notebook;
@property (nonatomic, retain) NSString* pdfPath;
@property (nonatomic, retain) NSString* username;
@property (nonatomic, retain) NSMutableData* pdfData;
@property (nonatomic, retain) NSArray* documentDirectories;
@property (nonatomic, retain) NSString* documentDirectory;
@property (nonatomic, retain) NSString* documentDirectoryFilename;
@property (nonatomic, retain) ActiveDeckViewController* callingVC;
@property (nonatomic, retain) NSMutableArray* viewsToSave;
@property (nonatomic, retain) NSMutableArray* currentPos;
@property (readwrite) CGRect pdfBounds;
@property (readwrite) BOOL isCancelled;

-(PDFFactory*)init:(NSString*)presID:(NSMutableArray*)slidesToExport:(AD_ContainerOB*)notebookToSave:(ActiveDeckViewController*)fromVC:(NSString*)uname:(NSMutableArray*)currentPosition;

-(void)initPDF;
-(void)saveSlideToPDF:(AD_Slide*)slide;
-(void)addPageViews:(SlideViewController *)svc;
-(void)createPDFPage:(id)objectForPDF;
-(void)promptToOpenPDF;
-(void)cleanup:(NSMutableArray*)array;
@end
